﻿using System.Xml.Linq;
using WebApplication1.Model;

namespace WebApplication1.Service
{
    public class ChatService
    {
        #region properties
        private List<StreamData> StreamDatas = new List<StreamData>();
        private Dictionary<string, GroupModel> GroupDatas = new Dictionary<string, GroupModel>();
        private   List<UserModel> Users { get; set; } = new List<UserModel>();
        private Dictionary<String, StreamData[]> SingleChatDatas = new Dictionary<String, StreamData[]>();

        private Dictionary<string, GroupModel> ShareDatas = new Dictionary<string, GroupModel>();
        #endregion
        public ChatService() { }
        #region Chat User
        public void AddUser(UserModel user)
        {
            Users.Add(user);
        }
        public List<UserModel> GetAllUser() => Users;
        #endregion
        #region Stream
        public void AddStream(StreamData stream)
        {
            StreamDatas.Add(stream);
        }
        public List<StreamData> GetAllStream() => StreamDatas;
        #endregion
        #region SingleChat
        public void AddSingleChat(string key, StreamData[] streamDatas)
        {
            SingleChatDatas.Add(key, streamDatas);
        }
        public Dictionary<String, StreamData[]> GetSingleChat() => SingleChatDatas;
        #endregion
        #region GroupChat
        public void AddGroupChat(string key, GroupModel group)
        {
            GroupDatas.Add(key, group);
        }
        public Dictionary<String, GroupModel> GetGroupChat() => GroupDatas;
        #endregion
        #region ShareDisplay
        public void AddShare(string key, GroupModel group)
        {
            ShareDatas.Add(key, group);
        }
        public Dictionary<String, GroupModel> GetShare() => ShareDatas;
        #endregion
    }
}
